/* eslint-disable camelcase */
import request, { MyResponseType } from '@/app/http';

export interface IDetailRequest {
    id: number;
}
// export interface IDetailResponse {
//     [key:string]: string;
// }
export interface IDetailData {
id: string;
timestamp: number;
author: string;
reviewer: string;
title: string;
'content_short': string;
forecast: number;
importance: number;
type: string;
status: string;
display_time: string;
comment_disabled: boolean;
pageviews: number;
image_uri: string;
head_img: string;
platforms: string[];
}

export interface IDetailResponse {
 code: number;
 data: IDetailData;
}
export const getDetail = (id: number): Promise<MyResponseType<IDetailData>> => {
  console.log('🚀 ~ file: detailAPI.ts ~ line 7 ~ id', id);

  return request<IDetailData>({
    url: '/api/getContent',
    method: 'get',
    params: { id },
  });
};
